#include "historicobeginimpl.h"

#include "loginUi.h"

extern loginUi *login;

historicobeginImpl::historicobeginImpl( QWidget * parent, Qt::WFlags f) 
	: QDialog(parent, f)
{
	setupUi(this);
	connect(pb_cancel,SIGNAL(clicked()),this,SLOT(hide()));
	connect(pb_ok,SIGNAL(clicked()),this,SLOT(onClicked()));
}

void historicobeginImpl::onClicked() {
	login->win.getHistoricFromWell(cb_well->currentText());
	this->hide();
}

void historicobeginImpl::showEvent ( QShowEvent *) {
	cb_well->clear();
	std::map<QString,wells>::iterator begin = login->win.wMap.begin();
	for(; begin != login->win.wMap.end(); begin++){
		cb_well->addItem(begin->second.name);
	}
}


